﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>商品类别页- ${web.name}${web.additionalTitle!}</title>
<script src="${sysResRoot}/jquery.js" type="text/javascript"></script>
<link href="${root}/u/css/main.css" type="text/css" rel="stylesheet" />
<link href="${root}/u/css/memeber.css" type="text/css" rel="stylesheet" />
<link href="${sysResRoot}/front.css" rel="stylesheet" type="text/css"/>
<link href="${base}/res/common/css/jquery.ui.css" rel="stylesheet" type="text/css"/>
<script src="${base}/res/common/js/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
function g(o){
	return document.getElementById(o);
}

function childList(parentId,deep){
	$.getJSON("../product/product_categorychild.jspx",{
		parentId:parentId
		},function(topics) {
	          $("#category"+deep).remove();
	          $("#brand").remove();
		      var ts="";
		      var len = topics.length;
		      if(topics[0].success){
		    	  ts="<div id='category"+deep+"' class='dclb' name='"+deep+"' style='float:left; width:210px; height:290px; border:1px solid #dfe2eb; overflow-y:auto; border-left:0; '><ul>";
		         for(var i=0;i<len;i++) {
			       ts+="<li onmouseover=this.style.backgroundColor='#f2f2f2' onmouseout=this.style.backgroundColor='#FFFFFF' onclick=childList("+topics[i].id+","+(deep+1)+");>"+topics[i].name+"</li>";
		        }
		      }else{
		    	$("#CatePubSub").removeAttr("disabled");
		    	$("#categoryId").val(parentId);
		    	ts="<div id='brand' class='dclb' style='float:left; width:210px; height:290px; border:1px solid #dfe2eb; border-left:0;  overflow-y:auto;'><ul>";
			    for(var j=0;j<len;j++) {
				    ts+="<li onmouseover=this.style.backgroundColor='#f2f2f2' onmouseout=this.style.backgroundColor='#FFFFFF' onclick=brandList("+topics[j].id+","+parentId+"); style='list-style-type:none; text-indent:1em; height:24px; line-height:24px; cursor:pointer;'>"+topics[j].name+"</li>";
				}
		      }
		       ts+="</ul></div>";
		      $('#picBefore').before(ts);
		      $("div[id^='category']").each(function(){
                      if(parseInt(this.name)>deep){$("#"+this.id).remove();}
		      });
	});
}

function brandList(brandId,categoryId){
    $("#brandId").val(brandId);
}
</script>

</head>
<body>
[#include "../include/shop_top.html"/]
<div class="w1168">
	[#include "店铺中心_导航.html"/]
	<div class="user_right">
    	<div class="user_title2">发布宝贝</div>
    	<div class="clear10"></div> 
        <form method="post" action="v_add.jspx" id="jvForm">
        <input type="hidden" name="brandId" id="brandId"/>
        <input type="hidden" name="categoryId" id="categoryId"/>
        <div style="width:850px; margin:auto;height:auto;overflow-x:auto;overflow-y:hidden;">
        <div class="dclb" style="overflow-y:auto;">
            <ul>
                [#if clist?size gt 0]
                [#list clist as category]
                <li onclick="childList(${category.id},${category.deep});" onmouseover="this.style.backgroundColor='#f2f2f2'" onmouseout="this.style.backgroundColor='#FFFFFF'" style="cursor:pointer;">${category.name}</li>
                [/#list]
                [/#if]
            </ul>
        </div>
        <div id="picBefore" style="clear:both"></div>
        </div>
        <div class="clear10"></div>
        <div class="clear10"></div>
        <div style=" margin:20px auto; width:303px;">
        <input type="submit" id="CatePubSub" value="" disabled="disabled" style=" width:303px; height:52px;cursor:pointer; background:url(${root}/u/img/member/menu_fbsp.gif);" />
        </div> 
        </form>
	</div>
    <div class="clear10"></div> 
    <div class="clear10"></div> 
</div>
[#include "../include/footer_information_bar.html"/]
</body>
</html>